import gjRequest from '../index'
import { loginface, ILoginReult, IDataype, Roles } from './type'

export function loginReq(account: loginface) {
  return gjRequest.request<IDataype<ILoginReult>>({
    url: '/login',
    method: 'POST',
    data: account
  })
}

export function userInfoReq(id: number) {
  return gjRequest.request<IDataype>({
    url: '/users/' + id,
    method: 'GET'
  })
}

export function userRoles(id: number) {
  return gjRequest.request<IDataype<Roles>>({
    url: `/role/${id}/menu`,
    method: 'GET'
  })
}
